<%@page import="dto.mailDTO"%>
<%@page import="vo.mailVO"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" href="../css/mail.css">
<script src = '../js/mail.js'></script>
</head>
<body>
<jsp:useBean id="vo" class="vo.mailVO" scope="page"/>
<jsp:setProperty property="*" name="vo"/>

<% 	
	mailDTO dto = new mailDTO();
	String e_m_id = (String)session.getAttribute("sessionMid");
/* 	out.print("세션에서 받은 id: " + e_m_id + "<br/>"); */
	vo.setM_id(e_m_id);
	mailVO v = dto.emailInfo(vo);
/* 	out.print("v에 셋팅된 이메일 : " + v.getEmail_address()+ "<br/>");
	out.print("v에 셋팅된 비밀번호: " + v.getEmail_pwd()+ "<br/>"); */
%>

<form name="hiddenFrm" method="post">	 <!-- 값이 input_result로 넘어간다  -->
	<input type='hidden' name='m_id' value="<%=v.getM_id() %>"/>
</form>
<p>
<img alt="" src="../images/m_title_mail_write.png"/>
<br>
작성하실 내용을 입력해주세요. 
<hr>
<form action="main.jsp?inc=../mail/mail_input_result.jsp&left_menu=../mail/mail_menu.jsp" 
		name = 'mail_write_frm' method="post" >

<label class = 'lbl'>보내는 사람</label>
<input type = 'text' size = '70' name ='email_sender' value="<%=v.getEmail_address() %>" maxlength ='20' style="margin-bottom: 3px;"/><br/>

<label class = 'lbl'>받는 사람 </label>
<input type = 'text' size = '67' name ='email_receiver' maxlength ='20' style="margin-bottom: 3px;"/>
<input type="radio"><label style="font-size: small;">내게 쓰기</label><br/>

<label class = 'lbl'>파일 첨부</label>
<input type = "file"  name ='filetext' id="filetext" 
onchange="this.select(); 
document.getElementById('email_filename').value=document.selection.createRange().text.toString();" /><br/>

<label class = 'lbl'>제 목</label>
<input type = 'text' size = '78' name ='email_subject' maxlength ='20' style="margin-bottom: 3px;"/><br/>

<label class = 'lbl'>내 용</label><br/>
<textarea cols="80" name="email_contents" rows="20" style="margin-left: 104px; margin-bottom: 3px;"></textarea><br/>
<br/>
<input type="image" src="../images/button_blue_submit.png" id="btnSend" value="보내기" style="margin-left: 600px;">

<input type='hidden' name='e_name' value="<%=v.getE_name()%>"/>
<input type='hidden' name='m_id' value="<%=v.getM_id() %>"/>
<input type='hidden' name='email_pwd' value="<%=v.getEmail_pwd() %>"/>
<input type='hidden' name='email_filename' id='email_filename' value=""/>

</form>
</body>
<script>sendsmtp();</script>
</html>
